home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 5 / BBS in a Box -Volume V (BBS in a Box) (April 1992).iso / Files / Hyper / Hy-Hyperi / HYPER PAYROLL.cpt / HYPER PAYROLL / background_2757.txt < prev    next >
Encoding:
Text File  |  1988-04-05  |  8.5 KB  |  389 lines

  1. -- background: 2757 from stack: in
  2. -- bmap block id: 5186
  3. -- flags: 4000
  4. -- background id: 0
  5. -- name: HYPER PAYROLL
  6.  
  7.  
  8. -- part 1 (field)
  9. -- low flags: 00
  10. -- high flags: 4000
  11. -- rect: left=75 top=66 right=129 bottom=249
  12. -- title width / last selected line: 0
  13. -- icon id / first selected line: 0 / 0
  14. -- text alignment: 0
  15. -- font id: 3
  16. -- text size: 12
  17. -- style flags: 256
  18. -- line height: 16
  19. -- part name: Name
  20. ----- HyperTalk script -----
  21. on mouseUp
  22.   set textAlign of field "Name" to left
  23. end mouseUp
  24.  
  25.  
  26. -- part 2 (field)
  27. -- low flags: 00
  28. -- high flags: 4000
  29. -- rect: left=338 top=98 right=128 bottom=396
  30. -- title width / last selected line: 0
  31. -- icon id / first selected line: 0 / 0
  32. -- text alignment: 0
  33. -- font id: 3
  34. -- text size: 12
  35. -- style flags: 0
  36. -- line height: 16
  37. -- part name: Job
  38.  
  39.  
  40. -- part 3 (field)
  41. -- low flags: 00
  42. -- high flags: 4000
  43. -- rect: left=455 top=96 right=112 bottom=509
  44. -- title width / last selected line: 0
  45. -- icon id / first selected line: 0 / 0
  46. -- text alignment: 0
  47. -- font id: 3
  48. -- text size: 12
  49. -- style flags: 0
  50. -- line height: 16
  51. -- part name: Fed%
  52.  
  53.  
  54. -- part 4 (field)
  55. -- low flags: 00
  56. -- high flags: 0000
  57. -- rect: left=455 top=113 right=128 bottom=506
  58. -- title width / last selected line: 0
  59. -- icon id / first selected line: 0 / 0
  60. -- text alignment: 0
  61. -- font id: 3
  62. -- text size: 12
  63. -- style flags: 0
  64. -- line height: 16
  65. -- part name: St%
  66.  
  67.  
  68. -- part 7 (button)
  69. -- low flags: 00
  70. -- high flags: 0000
  71. -- rect: left=457 top=25 right=48 bottom=509
  72. -- title width / last selected line: 0
  73. -- icon id / first selected line: 1013 / 1013
  74. -- text alignment: 1
  75. -- font id: 0
  76. -- text size: 12
  77. -- style flags: 0
  78. -- line height: 16
  79. -- part name: Right
  80. ----- HyperTalk script -----
  81. on mouseUp
  82.   go to next card
  83. end mouseUp
  84.  
  85.  
  86.  
  87. -- part 8 (button)
  88. -- low flags: 00
  89. -- high flags: 0000
  90. -- rect: left=354 top=25 right=46 bottom=383
  91. -- title width / last selected line: 0
  92. -- icon id / first selected line: 1015 / 1015
  93. -- text alignment: 1
  94. -- font id: 0
  95. -- text size: 12
  96. -- style flags: 0
  97. -- line height: 16
  98. -- part name: ComputePay
  99. ----- HyperTalk script -----
  100. on mouseUp
  101.  
  102.   -- SET FORMAT
  103.   set textAlign of field "CurrPay" to right
  104.   set textStyle of field "CurrPay" to bold
  105.   set textAlign of field "JOB" to left
  106.   set textStyle of field "Name" to bold
  107.   set cursor to 4
  108.  
  109.   -- SET GLOBALS
  110.   global FICA1
  111.   global FICA2
  112.   global FUTA1
  113.   global FUTA2
  114.   global SUTA1
  115.   global SUTA2
  116.   global FICAtotal
  117.  
  118.   -- CLEAR LAST TOTALS BEFORE CALCULATING NEW PAY
  119.   repeat with x = 1 to 11
  120.     if x = 3 then next repeat
  121.     if x = 7 then next repeat
  122.     if x = 8 then next repeat
  123.     put empty into line x of field "CurrPay"
  124.   end repeat
  125.  
  126.   -- CLEAR VARIABLES
  127.   put 0 into sum
  128.   put 0 into sum2
  129.   put 0 into limit
  130.   put 0 into paid
  131.   put 0 into paid1
  132.   put 0 into whTax
  133.  
  134.   -- COMPUTE REGULAR PAY
  135.   set numberFormat to 0.00
  136.   if line 1 of field "Job" = " " or line 1 of field "Hours" = " " then
  137.     put empty into line 1 of field "CurrPay"
  138.   else
  139.     if line 1 of field "Job" <> empty then
  140.       put line 1 of field "Job" into pay1
  141.       if line 1 of field "Hours" <> empty then
  142.         put line 1 of field "Hours" into pay2
  143.         multiply pay1 by pay2
  144.         multiply pay1 by 100
  145.         put round(pay1) into rd1
  146.         divide rd1 by 100
  147.         put rd1 into line 1 of field "CurrPay"
  148.         add rd1 to sum
  149.       end if
  150.     end if
  151.   end if
  152.  
  153.   -- COMPUTE OVERTIME
  154.   if line 2 of field "Job" = " " or line 2 of field "Hours" = " " then
  155.     put 0 into line 2 of field "CurrPay"
  156.   else
  157.     if line 2 of field "Job" <> empty then
  158.       put line 1 of field "Job" into pay3
  159.       put line 2 of field "Job" into pay4
  160.       put line 2 of field "Hours" into pay5
  161.       multiply pay4 by pay3
  162.       multiply pay4 by pay5
  163.       multiply pay4 by 100
  164.       put round(pay4) into rd4
  165.       divide rd4 by 100
  166.       put rd4 into line 2 of field "CurrPay"
  167.       add rd4 to sum
  168.     end if
  169.   end if
  170.  
  171.   -- ADD OTHER PAY
  172.   if line 3 of field "CurrPay" <> empty then
  173.     add line 3 of field "CurrPay" to sum
  174.   end if
  175.  
  176.   -- COMPUTE FICA
  177.   put FICA1 into FICA
  178.   multiply FICA by sum
  179.   multiply FICA by 100
  180.   put round(FICA) into whtax
  181.   divide whtax by 100
  182.   -- see if it's over limit
  183.   put FICAtotal into limit2
  184.   multiply limit2 by 100
  185.   put round(limit2) into limit
  186.   divide limit by 100
  187.   put line 4 of field "YTDtotal" into paid1
  188.   put line 4 of field "YTDtotal" into paid
  189.   if paid1 >= limit then
  190.     put 0 into line 4 of field "CurrPay"
  191.   else
  192.     add whtax to paid1
  193.     if paid1 >= limit and paid  < limit then
  194.       put limit - paid into paid3
  195.       put paid3 into line 4 of field"CurrPay"
  196.       add paid3 to sum2
  197.     else
  198.       put whtax into line 4 of field "CurrPay"
  199.       add whtax to sum2
  200.     end if
  201.   end if
  202.  
  203.   -- COMPUTE FED WITHHOLDING TAX
  204.   if line 1 of field "Fed%" <> empty then
  205.     put line 1 of field "Fed%" into deduct2
  206.     multiply deduct2 by sum
  207.     multiply deduct2 by 100
  208.     put round(deduct2) into drd2
  209.     divide drd2 by 100
  210.     put drd2 into line 5 of field "CurrPay"
  211.     add drd2 to sum2
  212.   end if
  213.  
  214.   -- COMPUTE STATE WITHHOLDING TAX
  215.   if line 1 of field "St%" <> empty then
  216.     put line 1 of field "St%" into deduct3
  217.     multiply deduct3 by sum
  218.     multiply deduct3 by 100
  219.     put round(deduct3) into drd3
  220.     divide drd3 by 100
  221.     put drd3 into line 6 of field "CurrPay"
  222.     add drd3 to sum2
  223.   end if
  224.  
  225.   -- ADD MISC. WITHHOLDINGS TO TOTAL DEDUCTS
  226.   if line 7 of field "CurrPay" <> empty then
  227.     add value of line 7 of field "CurrPay" to sum2
  228.   end if
  229.   if line 8 of field "CurrPay" <> empty then
  230.     add value of line 8 of field "CurrPay" to sum2
  231.   end if
  232.  
  233.   -- RECAP TOTAL PAY
  234.   put sum into line 9 of field "CurrPay"
  235.   put sum2 into line 10 of field "CurrPay"
  236.   subtract sum2 from sum
  237.   put sum into line 11 of field "CurrPay"
  238.  
  239.   set cursor to 0
  240. end mouseUp
  241.  
  242.  
  243.  
  244. -- part 9 (field)
  245. -- low flags: 00
  246. -- high flags: 4000
  247. -- rect: left=98 top=135 right=229 bottom=142
  248. -- title width / last selected line: 0
  249. -- icon id / first selected line: 0 / 0
  250. -- text alignment: 65535
  251. -- font id: 3
  252. -- text size: 12
  253. -- style flags: 0
  254. -- line height: 16
  255. -- part name: Hours
  256. ----- HyperTalk script -----
  257. on openField
  258.   set textAlign of field "hours" to right
  259. end openField
  260.  
  261.  
  262.  
  263. -- part 11 (field)
  264. -- low flags: 00
  265. -- high flags: 4000
  266. -- rect: left=327 top=154 right=331 bottom=413
  267. -- title width / last selected line: 0
  268. -- icon id / first selected line: 0 / 0
  269. -- text alignment: 65535
  270. -- font id: 3
  271. -- text size: 12
  272. -- style flags: 0
  273. -- line height: 16
  274. -- part name: QtrTotal
  275.  
  276.  
  277. -- part 12 (field)
  278. -- low flags: 00
  279. -- high flags: 4000
  280. -- rect: left=236 top=154 right=331 bottom=321
  281. -- title width / last selected line: 0
  282. -- icon id / first selected line: 0 / 0
  283. -- text alignment: 65535
  284. -- font id: 3
  285. -- text size: 12
  286. -- style flags: 256
  287. -- line height: 16
  288. -- part name: CurrPay
  289.  
  290.  
  291. -- part 13 (field)
  292. -- low flags: 00
  293. -- high flags: 4007
  294. -- rect: left=4 top=235 right=338 bottom=158
  295. -- title width / last selected line: 0
  296. -- icon id / first selected line: 0 / 0
  297. -- text alignment: 0
  298. -- font id: 3
  299. -- text size: 9
  300. -- style flags: 0
  301. -- line height: 12
  302. -- part name: Evaluation
  303.  
  304.  
  305. -- part 14 (field)
  306. -- low flags: 00
  307. -- high flags: 4000
  308. -- rect: left=420 top=154 right=332 bottom=508
  309. -- title width / last selected line: 0
  310. -- icon id / first selected line: 0 / 0
  311. -- text alignment: 65535
  312. -- font id: 3
  313. -- text size: 12
  314. -- style flags: 0
  315. -- line height: 16
  316. -- part name: YTDtotal
  317.  
  318.  
  319. -- part 15 (button)
  320. -- low flags: 00
  321. -- high flags: 0000
  322. -- rect: left=59 top=28 right=47 bottom=91
  323. -- title width / last selected line: 0
  324. -- icon id / first selected line: 21700 / 21700
  325. -- text alignment: 1
  326. -- font id: 0
  327. -- text size: 12
  328. -- style flags: 0
  329. -- line height: 16
  330. -- part name: Home
  331. ----- HyperTalk script -----
  332. on mouseUp
  333.   go to stack "Home"
  334. end mouseUp
  335.  
  336.  
  337.  
  338.  
  339. -- part 16 (field)
  340. -- low flags: 00
  341. -- high flags: 4000
  342. -- rect: left=338 top=62 right=96 bottom=509
  343. -- title width / last selected line: 0
  344. -- icon id / first selected line: 0 / 0
  345. -- text alignment: 0
  346. -- font id: 3
  347. -- text size: 12
  348. -- style flags: 0
  349. -- line height: 16
  350. -- part name: 
  351.  
  352.  
  353. -- part 17 (button)
  354. -- low flags: 00
  355. -- high flags: 8004
  356. -- rect: left=99 top=26 right=45 bottom=145
  357. -- title width / last selected line: 0
  358. -- icon id / first selected line: 0 / 0
  359. -- text alignment: 1
  360. -- font id: 0
  361. -- text size: 12
  362. -- style flags: 0
  363. -- line height: 16
  364. -- part name: Find
  365. ----- HyperTalk script -----
  366. on mouseUp
  367.   doMenu "Find..."
  368. end mouseUp
  369.  
  370.  
  371.  
  372. -- part 19 (button)
  373. -- low flags: 00
  374. -- high flags: 0000
  375. -- rect: left=10 top=25 right=48 bottom=49
  376. -- title width / last selected line: 0
  377. -- icon id / first selected line: 1014 / 1014
  378. -- text alignment: 1
  379. -- font id: 0
  380. -- text size: 12
  381. -- style flags: 0
  382. -- line height: 16
  383. -- part name: Left
  384. ----- HyperTalk script -----
  385. on mouseUp
  386.   go to prev card
  387. end mouseUp
  388.  
  389.